//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
 

	/// <summary>
	/// </summary>
	public class ThuVien_BA
	{
		public ThuVien_BA() {}
#region 'Variables And Properties'
		 private int int_IdThuVien ;
		 public int IdThuVien
			{
			 get 	
				{
					 return this.int_IdThuVien;
				}
			 set 	
				{
					int_IdThuVien=value;
				}
			}
		 private string string_TenThuVien ;
		 public string TenThuVien
			{
			 get 	
				{
					 return this.string_TenThuVien;
				}
			 set 	
				{
					string_TenThuVien=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the ThuVien table.
		/// <summary>
		/// <param name="IdThuVien"></param>
		/// <param name="TenThuVien"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			ThuVien_DA clsDA_ThuVien = new ThuVien_DA();
			clsDA_ThuVien.IdThuVien=int_IdThuVien;
			clsDA_ThuVien.TenThuVien=string_TenThuVien;

            boolInsert = clsDA_ThuVien.Insert(SqlCnn);
			clsDA_ThuVien = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the ThuVien table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			ThuVien_DA clsDA_ThuVien = new ThuVien_DA();
			DataTable dt = new DataTable();
            dt = clsDA_ThuVien.Select(SqlCnn);
			clsDA_ThuVien= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the ThuVien table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			ThuVien_DA clsDA_ThuVien = new ThuVien_DA();
			DataTable dt = new DataTable();
			clsDA_ThuVien.IdThuVien=int_IdThuVien;

            dt = clsDA_ThuVien.SelectPrimaryKey(SqlCnn);
			clsDA_ThuVien= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the ThuVien table.
		/// <summary>
		/// <param name="IdThuVien"></param>
		/// <param name="TenThuVien"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			ThuVien_DA clsDA_ThuVien = new ThuVien_DA();
			clsDA_ThuVien.IdThuVien=int_IdThuVien;
			clsDA_ThuVien.TenThuVien=string_TenThuVien;

            boolUpdate = clsDA_ThuVien.Update(SqlCnn);
			clsDA_ThuVien = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the ThuVien table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			ThuVien_DA clsDA_ThuVien = new ThuVien_DA();
			clsDA_ThuVien.IdThuVien=int_IdThuVien;

            boolDelete = clsDA_ThuVien.Delete(SqlCnn);
			clsDA_ThuVien = null ;
			return boolDelete;
		}
	}

